<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../template/WorkspaceTemplate.xhtml"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:f="http://java.sun.com/jsf/core">

    <ui:define name="top">
        
    </ui:define>

    <ui:define name="left">
       
    </ui:define>

    <ui:define name="right">
       
    </ui:define>

    <ui:define name="content">
        <h:form>
            <p:panel id="editRoleData" style="width: 100%">
                <h:panelGrid columns="3">
                    <h:outputLabel for="rolename" value="New Role Name: " />  
                    <p:inputText value="#{userRoleManagerBean.roleName}" 
                                 id="rolename" required="true" requiredMessage="Role name should not be empty." label="rolename"
                                 validator="#{userRoleManagerBean.checkRolenameExists}"/>  
                    <p:message id="msg1" for="rolename"/>

                    <h:outputLabel for="department" value="New Department: * " />  
                    <h:selectOneMenu value="#{userRoleManagerBean.department}" 
                                     id="department" required="true" label="department">
                        <f:selectItems value="#{userRoleManagerBean.allDepartments}" var="dep" itemLabel="#{dep}" itemValue="#{dep}"/>
                    </h:selectOneMenu>
                    <p:message for="department"/>

                    <f:facet name="footer">  
                        <p:commandButton value="Submit" ajax="false"
                                         actionListener="#{userRoleManagerBean.updateEditRole}" 
                                         action="editRole"
                                         oncomplete="handleUpdatingRequest(xhr, status, args)"/>  
                    </f:facet>
                </h:panelGrid>
            </p:panel>
        </h:form>
    </ui:define>

    <ui:define name="bottom">
       
    </ui:define>

</ui:composition>
